package com.train.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.train.common.Const;
import com.train.common.ServerResponse;
import com.train.dao.CourseMapper;
import com.train.pojo.Course;
import com.train.service.ICourService;

@Service
public class CourseServiceImpl implements ICourService {
	
	@Autowired
	private CourseMapper courseMapper;
	public ServerResponse selectCourseByCourseTypeId(Integer courseTypeId) {
		// TODO Auto-generated method stub
		List<Course> list = courseMapper.selectCourseByCourseTypeId(courseTypeId,Const.CourseStatus.SHANGJIA);
		if(list.size()==0){
			return ServerResponse.createByErrorMessage("当前分类还没有课程");
		}
		return ServerResponse.createBySuccess(list);
	}
}
